package com.ruoyi.teaching.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.teaching.mapper.TeachingCourseWareMapper;
import com.ruoyi.teaching.domain.TeachingCourseWare;
import com.ruoyi.teaching.service.ITeachingCourseWareService;
import com.ruoyi.common.core.text.Convert;

/**
 * 课件管理Service业务层处理
 * 
 * @author William
 * @date 2022-10-12
 */
@Service
public class TeachingCourseWareServiceImpl implements ITeachingCourseWareService 
{
    @Autowired
    private TeachingCourseWareMapper teachingCourseWareMapper;

    /**
     * 查询课件管理
     * 
     * @param wareId 课件管理主键
     * @return 课件管理
     */
    @Override
    public TeachingCourseWare selectTeachingCourseWareByWareId(Long wareId)
    {
        return teachingCourseWareMapper.selectTeachingCourseWareByWareId(wareId);
    }

    /**
     * 查询课件管理列表
     * 
     * @param teachingCourseWare 课件管理
     * @return 课件管理
     */
    @Override
    public List<TeachingCourseWare> selectTeachingCourseWareList(TeachingCourseWare teachingCourseWare)
    {
        return teachingCourseWareMapper.selectTeachingCourseWareList(teachingCourseWare);
    }

    /**
     * 新增课件管理
     * 
     * @param teachingCourseWare 课件管理
     * @return 结果
     */
    @Override
    public int insertTeachingCourseWare(TeachingCourseWare teachingCourseWare)
    {
        teachingCourseWare.setCreateTime(DateUtils.getNowDate());
        return teachingCourseWareMapper.insertTeachingCourseWare(teachingCourseWare);
    }

    /**
     * 修改课件管理
     * 
     * @param teachingCourseWare 课件管理
     * @return 结果
     */
    @Override
    public int updateTeachingCourseWare(TeachingCourseWare teachingCourseWare)
    {
        teachingCourseWare.setUpdateTime(DateUtils.getNowDate());
        return teachingCourseWareMapper.updateTeachingCourseWare(teachingCourseWare);
    }

    /**
     * 批量删除课件管理
     * 
     * @param wareIds 需要删除的课件管理主键
     * @return 结果
     */
    @Override
    public int deleteTeachingCourseWareByWareIds(String wareIds)
    {
        return teachingCourseWareMapper.deleteTeachingCourseWareByWareIds(Convert.toStrArray(wareIds));
    }

    /**
     * 删除课件管理信息
     * 
     * @param wareId 课件管理主键
     * @return 结果
     */
    @Override
    public int deleteTeachingCourseWareByWareId(Long wareId)
    {
        return teachingCourseWareMapper.deleteTeachingCourseWareByWareId(wareId);
    }
}
